import Admonition from "@theme/Admonition";

# Multiple Vector Stores

The example below shows an agent operating with two vector stores built upon different data sources.

The `TextLoader` loads a TXT file, while the `WebBaseLoader` pulls text from webpages into a document format to accessed downstream. The `Chroma` vector stores are created analogous to what we have demonstrated in our [CSV Loader](/examples/csv-loader.mdx) example. Finally, the `VectorStoreRouterAgent` constructs an agent that routes between the vector stores.

<Admonition type="info">
  Get the TXT file used
  [here](https://github.com/hwchase17/chat-your-data/blob/master/state_of_the_union.txt).
</Admonition>

URL used by the `WebBaseLoader`:

```text
https://pt.wikipedia.org/wiki/Harry_Potter
```

<Admonition type="tip">
  When you build the flow, request information about one of the sources. The
  agent should be able to use the correct source to generate a response.
</Admonition>

<Admonition type="info">
  Learn more about Multiple Vector Stores
  [here](https://python.langchain.com/docs/modules/data_connection/vectorstores/).
</Admonition>

## ⛓️ Langflow Example

import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";
import ZoomableImage from "/src/theme/ZoomableImage.js";

<ZoomableImage
  alt="Docusaurus themed image"
  sources={{
    light: "img/multiple-vectorstores.png",
    dark: "img/multiple-vectorstores.png",
  }}
/>

#### <a target="\_blank" href="json_files/Multiple_Vector_Stores.json" download>Download Flow</a>

<Admonition type="note" title="LangChain Components 🦜🔗">

- [`WebBaseLoader`](https://python.langchain.com/docs/integrations/document_loaders/web_base)
- [`TextLoader`](https://python.langchain.com/docs/modules/data_connection/document_loaders/)
- [`CharacterTextSplitter`](https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/character_text_splitter)
- [`OpenAIEmbedding`](https://python.langchain.com/docs/integrations/text_embedding/openai)
- [`Chroma`](https://python.langchain.com/docs/integrations/vectorstores/chroma)
- [`VectorStoreInfo`](https://python.langchain.com/docs/modules/data_connection/vectorstores/)
- [`OpenAI`](https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai)
- [`VectorStoreRouterToolkit`](https://js.langchain.com/docs/modules/agents/tools/how_to/agents_with_vectorstores)
- [`VectorStoreRouterAgent`](https://js.langchain.com/docs/modules/agents/tools/how_to/agents_with_vectorstores)

</Admonition>
